import * as fse from "fs-extra";

export function editXML(file: string) {
	const content = fse.readFileSync(file).toString();
	const lines = content.split("\n");

	for (let i = 0; i < lines.length; i++) {
		const line = lines[i];
		// 改 call -> calling
		if (
			line.includes("name") &&
			line.includes("call") &&
			!line.includes("calling")
		) {
			lines[i] = line.replace("call", "calling");
		}
	}

	const res = lines.join("\n");

	return res;
}
